package com.hzw.saas.web.admin.hpc.param;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author sonam
 * @since 2021/2/25 10:14
 */
@Data
@ApiModel(value = "创建购买订单参数")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class SubmitItemOrderParam extends SalesParam {

    @NotBlank(message = "HPCID不能为空")
    @ApiModelProperty(value = "HPCID", required = true)
    private String hpcId;

    @NotBlank(message = "用户ID不能为空")
    @ApiModelProperty(value = "用户ID", required = true)
    private String userId;

    @NotBlank(message = "商品名称不能为空")
    @ApiModelProperty(value = "商品名称", required = true)
    private String itemName;

    @DecimalMin(value = "0", inclusive=false, message = "商品价格不能小于0")
    @ApiModelProperty(value = "商品价格", required = true)
    private Double itemPrice;

    @DecimalMin(value = "0", inclusive=false, message = "核时不能小于0")
    @ApiModelProperty(value = "核时", required = true)
    private Long itemCoreTime;

    @DecimalMin(value = "0", inclusive=false, message = "有效期不能小于0")
    @ApiModelProperty(value = "有效期", required = true)
    private Integer itemDatePeriod;

    @Pattern(regexp = "^(D|M|S|Y)$", message = "请输入正确的时间单位,D/M/S/Y")
    @ApiModelProperty(value = "有效期单位(D|M|S|Y)", required = true)
    private String itemDateUnit;

    @ApiModelProperty(value = "HPC账号ID")
    private String hpcAccountId;

}
